var prefix = "/basCompany";
//var moduleFlag = '[[${moduleFlag}]]';

$(function () {
    load();
    $("#btn-search").click(function(){
        $("#exampleTable").bootstrapTable('refresh');
    });
});

function load() {
    $('#exampleTable').bootstrapTable(
        {
            method: 'post',
            url: prefix + "/list.do",
            iconSize: 'outline',
            toolbar: '#exampleToolbar',
            striped: true,
            dataType: "json",
            pagination: true,
            clickToSelect: true,
            pageSize: 10,
            pageNumber: 1,
            showColumns: false,
            sidePagination: "server",
            paginationLoop: false,
            contentType: "application/x-www-form-urlencoded",
            queryParams: function (params) {
                return {
                    filialeName: $("#query_pcode").val(),
                    limit: params.limit,
                    offset: params.offset
                };
            },
            onClickRow:function(row, $element){
                $element.addClass('info').siblings().removeClass('info').end();
            },
            /* onDblClickRow: function (row, $element, field) {
                 view(row.id);
             },*/
            columns: [
                {
                    field: 'idx',
                    formatter: orderFormatter,
                    title: '序号',
                    align: 'center',
                    width: '40'
                },
                {
                    field: 'filialeName',
                    title: '公司名称'
                },
                {
                    field: 'filialeAddr',
                    title: '公司地址'
                },
                {
                    field: 'airline2code',
                    title: '承运人编码'
                },
                {
                    field: 'chineseName',
                    title: '名称'
                },
                {
                    field: 'englishName',
                    title: '英文名称'
                },
                {
                    field: 'logo',
                    title: 'LOGO'
                }]
        })
}


//刷新
function reload() {
    $("#query_pcode").val("");
    $("#exampleTable").bootstrapTable('refresh');
}

